<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <title>用药错误事件上报详细表</title>
  <link rel="stylesheet" href="../layui/css/layui.css">
  <script src="../layui/layui.js"></script>
  <style>
    @page {
      width: 1200px ;
    }
    /*打印所用的css*/
    @media print {
      #button_bar {
        display: none;
      }

      #content_wrap {
        width: 1000px !important;
        /*布局的时候，为了给侧边栏留位置，给主体内容加了margin-left，现在需要去掉。*/
        margin-left: 0 !important;
        /*margin-bottom: 0 !important;*/
        /*margin-top: 0 !important;*/
        /*margin-right: 0 !important;*/
      }
    }
  </style>
</head>
<body>
<div class="layui-form-item" id="button_bar" >
  <div class="layui-input-block" style=" margin-top: 20px">
    <button type="button" class="layui-btn"  id = “back” onclick="self.location = document.referrer;">返回</button>
    <button type="button" class="layui-btn"  id="dayin">打印</button>
  </div>
</div>
<form class="layui-form" lay-filter="FormLoad"  id="content_wrap" >
  <!--startprint1-->

  <table border="1px" width="100%" cellpadding="0">
    <tr >
      <td colspan="6" style="text-align: center; height: 50px"> <span style=" font-size: 20px">药品不良反应/事件报告</span> </td>
    </tr>
    <tr>
      <td colspan="3" style="height: 30px"> <div>
        <input type="text" name="report_order" placeholder="" class="layui-input" disabled>
<!--        <input type="radio" name="report_order" value="首次报告" title="首次报告" disabled>-->
<!--        <input type="radio" name="report_order" value="跟踪报告" title="跟踪报告" disabled>-->
      </div> </td>
      <td colspan="1" style="height: 30px">
        编码
      </td>
      <td colspan="2" style="height: 30px">
        <input type="text" name="code" placeholder="" class="layui-input" disabled>
      </td>
    </tr>
    <tr>
      <div class="layui-form-item">
        <td>
          报告类型
        </td>
        <td colspan="2">
          <input type="text" name="report_type" placeholder="" class="layui-input" disabled>
<!--          <input type="radio" name="report_type" value="新的" title="新的" disabled>-->
<!--          <input type="radio" name="report_type" value="严重" title="严重" disabled>-->
<!--          <input type="radio" name="report_type" value="一般" title="一般" disabled>-->
        </td>

        <td>
          报告单位类型
        </td>

        <td colspan="2">
          <input type="text" name="reporter_unit_type" placeholder="" class="layui-input" disabled>
<!--          <input type="radio" name="reporter_unit_type" value="医疗机构" title="医疗机构" disabled>-->
<!--          <input type="radio" name="reporter_unit_type" value="经营企业" title="经营企业" disabled>-->
<!--          <input type="radio" name="reporter_unit_type" value="生产企业" title="生产企业" disabled>-->
<!--          <input type="radio" name="reporter_unit_type" value="其他" title="其他" disabled>-->
        </td>
      </div>
    </tr>
    <tr>
      <div class="layui-form-item">
        <td>
          患者姓名
        </td>
        <td>
          <input type="text" name="patient_name" placeholder="" class="layui-input" disabled>
        </td>

        <td>
          性别
        </td>

        <td>
          <input type="text" name="patient_sex" placeholder="" class="layui-input" disabled>
<!--          <input type="radio" name="patient_sex" value="男" title="男" disabled>-->
<!--          <input type="radio" name="patient_sex" value="女" title="女" disabled>-->
        </td>
        <td>
          出生日期
        </td>

        <td>
          <input type="text" name="patient_birthday" lay-verify="birth_date" id="birth_date" placeholder="" class="layui-input" disabled>
        </td>
      </div>
    </tr>
    <tr>
      <div class="layui-form-item">
        <td>
          民族
        </td>
        <td>
          <input type="text" name="patient_nation" placeholder="" class="layui-input" disabled>
        </td>

        <td>
          体重
        </td>

        <td>
          <input type="text" name="patient_weight" placeholder="" class="layui-input" disabled>
        </td>
        <td>
          联系方式
        </td>

        <td>
          <input  name="patient_phone" type="tel"  lay-verify="required|phone" class="layui-input" disabled>
        </td>
      </div>
    </tr>
    <tr>
      <div class="layui-form-item">
        <td>
          原患疾病
        </td>
        <td>
          <input type="text" name="original_illness" placeholder="" class="layui-input" disabled>
        </td>

        <td>
          医院名称
        </td>

        <td>
          <input type="text" name="hospital_name" placeholder="" class="layui-input" disabled>
        </td>
        <td>
          既往药品不良反应事件/事件
        </td>

        <td>
          <input type="text" name="original_med_bad_event" placeholder="" class="layui-input" disabled>
        </td>
      </div>
    </tr>
    <tr>
      <div class="layui-form-item">
        <td>
          病历号/门诊号
        </td>
        <td>
          <input type="text" name="patient_num" placeholder="" class="layui-input" disabled>
        </td>

        <td>
          家族药品不良反应/事件
        </td>

        <td>
          <input type="text" name="family_med__bad_event" placeholder="" class="layui-input" disabled>
        </td>
        <td colspan="2">
        </td>
      </div>
    </tr>
    <tr>
      <td colspan="1">
        相关重要信息
      </td>
      <td colspan="5">
        <input type="text" name="related_important_mes" placeholder="" class="layui-input" disabled>
<!--        <input type="radio" name="related_important_mes" value="吸烟史" title="吸烟史" disabled>-->
<!--        <input type="radio" name="related_important_mes" value="饮酒史" title="饮酒史" disabled>-->
<!--        <input type="radio" name="related_important_mes" value="妊娠期" title="妊娠期" disabled>-->
<!--        <input type="radio" name="related_important_mes" value="肝病史" title="肝病史" disabled>-->
<!--        <input type="radio" name="related_important_mes" value="肾病史" title="肾病史" disabled>-->
<!--        <input type="radio" name="related_important_mes" value="过敏史" title="过敏史" disabled>-->
<!--        <input type="radio" name="related_important_mes" value="其他" title="其他" disabled>-->
      </td>

    </tr>
    <tr>
      <div class="layui-form-item">
        <td colspan="6" style="height: 50px">
          药品
        </td>
      </div>
    </tr>
    <tr>
      <div class="layui-form-item">
        <td colspan="1">
          怀疑药品
        </td>
        <td colspan="5">
          <textarea name="doubt_med" style="height: 100px" required lay-verify="required" placeholder="" class="layui-textarea" disabled></textarea>
        </td>
      </div>
    </tr>
    <tr>
      <div class="layui-form-item">
        <td colspan="1">
          并用药品
        </td>
        <td colspan="5">
          <textarea name="unit_med" style="height: 100px" required lay-verify="required" placeholder="" class="layui-textarea" disabled></textarea>
        </td>
      </div>
    </tr>
    <tr>
      <div class="layui-form-item">
        <td colspan="1">
          不良反应/事件名称
        </td>
        <td colspan="2">
          <input type="text" name="bad_event_name" placeholder="" class="layui-input" disabled>
        </td>
        <td colspan="1">
          不良反应/事件发生时间
        </td>
        <td colspan="2">
          <input type="text" name="bad_event_happen_time" id="bad_time" placeholder="" class="layui-input" disabled>
        </td>
      </div>
    </tr>
    <tr style="font-size: 20px">
      <div class="layui-form-item">
        <td colspan="6">
          不良反应/事件过程描述(包括症状，体征，临床检验)及处理情况（可附页）
        </td>
      </div>
    </tr>
    <tr>
      <div class="layui-form-item">
        <td colspan="6">
          <textarea name="bad_event_process" style="height: 100px" required lay-verify="required" placeholder="" class="layui-textarea" disabled></textarea>
        </td>
      </div>
    </tr>
    <tr>
      <div class="layui-form-item">
        <td colspan="1">
          不良反应事件的结果
        </td>
        <td colspan="5">
          <input type="text" name="bad_event_result" id="" placeholder="" class="layui-input" disabled>
<!--          <input type="radio" name="bad_event_result" value="治愈" title="治愈" disabled>-->
<!--          <input type="radio" name="bad_event_result" value="好转" title="好转" disabled>-->
<!--          <input type="radio" name="bad_event_result" value="未好转" title="未好转" disabled>-->
<!--          <input type="radio" name="bad_event_result" value="不详" title="不详" disabled>-->
<!--          <input type="radio" name="bad_event_result" value="有后遗症" title="有后遗症" disabled>-->
<!--          <input type="radio" name="bad_event_result" value="死亡" title="死亡" disabled>-->
        </td>
      </div>
    </tr>
    <tr>
      <div class="layui-form-item">
        <td colspan="1">
          若有后遗症表现：
        </td>
        <td colspan="1">
          <input type="text" name="sequel_expression"  placeholder="" class="layui-input" disabled>
        </td>
        <td colspan="1">
          若死亡直接死因：
        </td>
        <td colspan="1">
          <input type="text" name="death_direct_reason"  placeholder="" class="layui-input" disabled>
        </td>
        <td colspan="1">
          死亡时间：
        </td>
        <td colspan="1">
          <input type="text" name="death_time" id="death_time" placeholder="" class="layui-input" disabled>
        </td>
      </div>

    <tr>
      <div class="layui-form-item">
        <td colspan="2">
          停药或减药后，反应/事件是否消失或减轻：
        </td>
        <td colspan="4">
          <input type="text" name="bad_event_change"  placeholder="" class="layui-input" disabled>
<!--          <input type="radio" name="bad_event_change" value="是" title="是" disabled>-->
<!--          <input type="radio" name="bad_event_change" value="否" title="否" disabled>-->
<!--          <input type="radio" name="bad_event_change" value="不明" title="不明" disabled>-->
<!--          <input type="radio" name="bad_event_change" value="未减药或未停药" title="未减药或未停药" disabled>-->
        </td>
      </div>
    </tr>
    <tr>
      <td colspan="2">
        再次使用可疑药品后是否再次出现同样反应/事件
      </td>
      <td colspan="4">
        <input type="text" name="bad_event_alike_happen"  placeholder="" class="layui-input" disabled>
<!--        <input type="radio" name="bad_event_alike_happen" value="是" title="是" disabled>-->
<!--        <input type="radio" name="bad_event_alike_happen" value="否" title="否" disabled>-->
<!--        <input type="radio" name="bad_event_alike_happen" value="不明" title="不明" disabled>-->
<!--        <input type="radio" name="bad_event_alike_happen" value="未在使用" title="未在使用" disabled>-->
      </td>
    </tr>
    <tr>
      <td colspan="2">
        对原患疾病的影响
      </td>
      <td colspan="4">
        <input type="text" name="original_illness_influence"  placeholder="" class="layui-input" disabled>

<!--        <input type="radio" name="original_illness_influence" value="不明显" title="不明显" disabled>-->
<!--        <input type="radio" name="original_illness_influence" value="病程延长" title="病程延长" disabled>-->
<!--        <input type="radio" name="original_illness_influence" value="病情加重" title="病情加重" disabled>-->
<!--        <input type="radio" name="original_illness_influence" value="导致后遗症" title="导致后遗症" disabled>-->
<!--        <input type="radio" name="original_illness_influence" value="导致死亡" title="导致死亡" disabled>-->
      </td>
    <tr>
      <td rowspan="2">
        关联性评价
      </td>
      <td colspan="1">
        报告人评价
      </td>
      <td colspan="2">
        <input type="text" name="reporter_appraise"  placeholder="" class="layui-input" disabled>
<!--        <input type="radio" name="reporter_appraise" value="可能" title="可能" disabled>-->
<!--        <input type="radio" name="reporter_appraise" value="可能无关" title="可能无关" disabled>-->
<!--        <input type="radio" name="reporter_appraise" value="待评价" title="待评价" disabled>-->
<!--        <input type="radio" name="reporter_appraise" value="无法评价" title="无法评价" disabled>-->
      </td>
      <td colspan="1">
        签名
      </td>
      <td colspan="1">
        <input type="text" name="reporter_appraise_sign"  placeholder="" class="layui-input" disabled>
      </td>
    </tr>
    <tr>
      <td colspan="1">
        报告人单位评价
      </td>
      <td colspan="2">
        <input type="text" name="reporter_unit_appraise"  placeholder="" class="layui-input" disabled>
<!--        <input type="radio" name="reporter_unit_appraise" value="肯定" title="肯定" disabled>-->
<!--        <input type="radio" name="reporter_unit_appraise" value="很可能" title="很可能" disabled>-->
<!--        <input type="radio" name="reporter_unit_appraise" value="可能" title="可能" disabled>-->
<!--        <input type="radio" name="reporter_unit_appraise" value="可能无关" title="可能无关" disabled>-->
<!--        <input type="radio" name="reporter_unit_appraise" value="待评价" title="待评价" disabled>-->
<!--        <input type="radio" name="reporter_unit_appraise" value="无法评价" title="无法评价" disabled>-->
      </td>
      <td colspan="1">
        签名
      </td>
      <td colspan="1">
        <input type="text" name="reporter_unit_appraise_sign"  placeholder="" class="layui-input" disabled>
      </td>
    </tr>
    <tr>
      <td rowspan="2">
        报告人信息
      </td>
      <td colspan="1">
        联系电话
      </td>
      <td colspan="1">
        <input type="text" name="reporter_phone"  lay-verify="required|phone" placeholder="" class="layui-input" disabled>
      </td>
      <td colspan="1">
        职业
      </td>
      <td colspan="2">
        <input type="text" name="reporter_profession"  placeholder="" class="layui-input" disabled>
<!--        <input type="radio" name="reporter_profession" value="医生" title="医生" disabled>-->
<!--        <input type="radio" name="reporter_profession" value="药师" title="药师" disabled>-->
<!--        <input type="radio" name="reporter_profession" value="护士" title="护士" disabled>-->
<!--        <input type="radio" name="reporter_profession" value="其他" title="其他" disabled>-->
      </td>
    </tr>
    <tr>
      <td colspan="1">
        电子邮箱
      </td>
      <td colspan="1">
        <input type="text" name="reporter_email"  placeholder="" lay-verify="required|email" class="layui-input" disabled>
      </td>
      <td colspan="1">
        签名
      </td>
      <td colspan="2">
        <input type="text" name="reporter_sign"  placeholder="" class="layui-input" disabled>
      </td>
    </tr>

    <tr>
      <td rowspan="2">
        报告单位信息
      </td>
      <td colspan="1">
        单位名称
      </td>
      <td colspan="1">
        <input type="text" name="reporter_unit_name"  placeholder="" class="layui-input" disabled>
      </td>
      <td colspan="1">
        联系人
      </td>
      <td colspan="2">
        <input type="text" name="reporter_unit_contact"  placeholder="" class="layui-input" disabled>
      </td>
    </tr>
    <tr>
      <td colspan="1">
        电话
      </td>
      <td colspan="1">
        <input type="text" name="reporter_unit_contact_phone"  placeholder="" class="layui-input" disabled>
      </td>
      <td colspan="1">
        报告日期
      </td>
      <td colspan="2">
        <input type="text" name="report_date" id="report_date" placeholder="" class="layui-input" disabled>
      </td>
    </tr>
    <tr>
      <td colspan="1">
        生产企业请填写信息来源
      </td>
      <td colspan="5">
        <input type="text" name="mes_source"  placeholder="" class="layui-input" disabled>
<!--        <input type="radio" name="mes_source" value="医疗机构" title="医疗机构" disabled>-->
<!--        <input type="radio" name="mes_source" value="经营企业" title="经营企业" disabled>-->
<!--        <input type="radio" name="mes_source" value="个人" title="个人" disabled>-->
<!--        <input type="radio" name="mes_source" value="文献报道" title="文献报道" disabled>-->
<!--        <input type="radio" name="mes_source" value="上市后研究" title="上市后研究" disabled>-->
<!--        <input type="radio" name="mes_source" value="其他" title="其他" disabled>-->
      </td>
    </tr>
    <tr>
      <td colspan="1">
        备注
      </td>
      <td colspan="5">
        <input type="text" name="remarks"  placeholder="" class="layui-input" disabled>
      </td>
    </tr>


  </table>
  <!--endprint1-->

</form>
</body>

<script>

  let str;
  layui.use(['laydate','jquery','form','layedit','layer','table','laytpl'], function() {
    let $ = layui.jquery;
    let form = layui.form;
    let laydate = layui.laydate;
    var layer = layui.layer;
    var router = layui.router();
    laydate.render({
      elem: '#reporter_know_time' //指定元素
      , type: 'date'
    });
    laydate.render({
      elem: '#event_happen_time' //指定元素
      , type: 'date'
    });

    // 打印固定地方
    function preview(oper) {
      if (oper < 10){
        var bdhtml=window.document.body.innerHTML;//获取当前页的html代码
        var sprnstr="<!--startprint"+oper+"-->";//设置打印开始区域
        var eprnstr="<!--endprint"+oper+"-->";//设置打印结束区域
        var prnhtml=bdhtml.substring(bdhtml.indexOf(sprnstr)+18); //从开始代码向后取html

        prnhtml=prnhtml.substring(0,prnhtml.indexOf(eprnstr));//从结束代码向前取html
        window.document.body.innerHTML=prnhtml;
        window.print();
        window.document.body.innerHTML=bdhtml;

      }
      else{
        window.print();
      }

    }
//获取打印按钮
    $("#dayin").click(function() {
      onclick=preview(1);
    })


    function getQueryVariable(variable)
    {
      let query = window.location.search.substring(1);
      let vars = query.split("&");
      for (let i=0;i<vars.length;i++) {
        let pair = vars[i].split("=");
        if(pair[0] == variable){return pair[1];}
      }
      return(false);
    }

    form.render();
    // 获取地址的中的值
    let form_code=getQueryVariable("form_code");
    console.log(form_code);
    $.ajax({
      url: '/look?form_code=' + form_code,
      type: 'get',
      success: function (data) {
        console.log(data);
        let jsonObj = eval('(' + data + ')'); //获得jsonObj对象
        console.log(jsonObj);
        //渲染 上报人和上报人单位
        //let json = {};
        for(let i = 0; i<jsonObj.data.length; i++) {
          //给input 框 赋值
          $('input[name= '+ jsonObj.data[i].property_en_name +']').attr("value",jsonObj.data[i].detailed_data);
          // 给 textarea赋值
          $('textarea[name= '+ jsonObj.data[i].property_en_name +']').text(jsonObj.data[i].detailed_data);
        }
        //form.val("FormLoad",json)
      }
    });

  })
</script>

</html>